package cn.glenn.egmvc2.controller;

import cn.glenn.egmvc2.pojo.dto.EmpInfoDTO;
import cn.glenn.egmvc2.pojo.enity.EmpInfo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class EmpController {
    @RequestMapping("/emp/add")
    @ResponseBody
    public String addEmp(EmpInfoDTO empInfoDTO) {
        System.out.println(empInfoDTO.getName() + empInfoDTO.getJob() + empInfoDTO.getSalary());
        return "添加成功";
    }

    @RequestMapping("/emp/update")
    @ResponseBody
    public String selectEmp(EmpInfo empInfo) {
        System.out.println(empInfo.getId() + empInfo.getName() + empInfo.getJob() + empInfo.getSalary());
        return "修改成功";
    }

    @RequestMapping("/emp/list")
    @ResponseBody
    public String listEmp() {
        return "查询成功";
    }

    @RequestMapping("/emp/delete")
    @ResponseBody
    public String deleteEmp(Integer id) {
        System.out.println("已删除" + id);
        return "删除成功";
    }
}
